#pragma once

#include "ILCommon.h"
#include "MapObject.h"
#include "UnitMesh.h"
#include "Camera.h"

class CUnit : public CMapObject
{
public:
	CUnit();
	CUnit(IntPoint StartingPoint, CTerrain* pTerrain, CCamera* pCamera, ID3D11Device* pDevice);
	~CUnit();

	void Render();
	void Update(float deltaTime);

	//calculate the path and start the movement of the Unit
	void Goto(IntPoint endPoint);
	void MoveUnit( IntPoint to );

private:
	CUnitMesh* m_pMeshInst;
	vec3 m_WorldPos;
	CCamera* m_pCamera;
	Path m_path;
	UINT m_activeWP;
	bool m_bMoving;
	vec3 m_lastWP;
	vec3 m_nextWP;
	float m_movePrc;
};